﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using com.pro2e.web.util.page;

public partial class whatis01result : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["v"] != null & Request["r1"] != null & Request["r2"] != null & Request["r3"] != null & Request["r4"] != null & Request["r5"] != null)
        {
            ltlValue.Text = Request["v"].ToString();
            ltlR1.Text = Request["r1"].ToString();
            ltlR2.Text = Request["r2"].ToString();
            ltlR3.Text = Request["r3"].ToString();
            ltlR4.Text = Request["r4"].ToString();
            ltlR5.Text = Request["r5"].ToString(); 
        }
        else 
        {
            string empty = "尚未選擇";
            ltlValue.Text = empty;
            ltlR1.Text = empty;
            ltlR2.Text = empty;
            ltlR3.Text = empty;
            ltlR4.Text = empty;
            ltlR5.Text = empty;
        }
    }
    protected void btnPrint_Click(object sender, ImageClickEventArgs e)
    {
        string r = GetRString();
       // OpenNewWin("whatis01print.aspx?" + r, ",國際勃起功能指標量表(IIEF-5)[列印]");
        Server.Transfer("whatis01print.aspx?" + r);
    }

    private string GetRString()
    {
        return "v=" + ltlValue.Text + "&r1="+ltlR1.Text+"&r2="+ltlR2.Text+"&r3="+ltlR3.Text+"&r4="+ltlR4.Text+"&r5="+ltlR5.Text;
    }
    private void OpenNewWin(string path, string customerName)
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(JavascriptUtil.WrapperScript("window.open (\"" + path + "\", \"" + customerName + "\", \"width=900,toolbar=no,resizable=yes,scrollbars=yes'\");"));
        ScriptManager.RegisterClientScriptBlock(lblMsg, lblMsg.GetType(), "js", sb.ToString(), false);
    }
}
